package com.jt.demo9;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Component
@PropertySource(value = "classpath:/dept.properties",encoding = "utf-8")
public class Dept {
    @Value("${dept.id}")
    private Integer id;
    @Value("${dept.name}")
    private String name;

    public void Hello(){
        System.out.println(id+" "+name);
    }
}
